#include "trap.h"
   .set noat
   .set mips32
   .globl main
   .text
main:

    syscall
    li $t0, 0x11111111

    li $a0, 0x3

    LOOP:
    addi $s0, $s0, 0x1
    bne $s0, $a0, LOOP
    break
    li $t1, 0x11111111

    li $s1, 0xbfc00000
    mtc0 $s1, $14
    mfc0 $s2, $14
    bne $s1, $s2, FALSE

    HIT_GOOD_TRAP

FALSE:
    HIT_BAD_TRAP

    .org 0x380	
       # li $s1, 0xd
        #li $s2, 0x0
        nop            #temu/cpu_exec()  have pc plus 4 before executes the instr at 0xbfc00380
                            #using nop 
        mfc0 $v0, $13, 0x0

        andi $v0, $v0, 0x00000ff
        srl $v0, $v0, 0x2
    
        # syscall
        li $s3, 0x08
        #beq $s3, $v0, ISSYSCALL
        # break
        li $s3, 0x09
        #beq $s3, $v0, ISBREAK

        ISSYSCALL:
            ERET
        ISBREAK:
            ERET
